<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    let arr1 = [{
            a: '1',
            b: 2,
            c: '3'
        },
        {
            a: 1,
            b: '2',
            name: 'nlx'
        },
        {
            d: 1,
            a: 5,
            age: 24
        }
    ]
    let temp = {}
    arr1.reduce((preReturn,currentObj)=>{
        for (const key in currentObj) {
            if (Object.hasOwnProperty.call(temp, key)) {
                if(temp[key] instanceof Array){
                    temp[key].push(currentObj[key])
                } else{
                    let arr = [temp[key],currentObj[key]]
                    temp[key] = arr
                }
            } else {
                temp[key] = currentObj[key]
            }
        }
        return temp
    },arr1[0])
    console.log(temp)
</script>

</html>